package com.xuecheng.media.feignclient.content;

import com.xuecheng.content.model.dto.QueryTeachplanMediaDto;
import com.xuecheng.content.model.po.TeachplanMedia;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TeachplanMediaClientFactory implements FallbackFactory<TeachplanMediaClient> {
    @Override
    public TeachplanMediaClient create(Throwable throwable) {
        return new TeachplanMediaClient() {
            @Override
            public TeachplanMedia getTeachplanMedia(QueryTeachplanMediaDto dto) {
                log.error("根据条件查询课程计划媒资关系的过程发生熔断:{}",throwable.toString(),throwable);
                return null;
            }
        };
    }
}
